import { TextualState } from "../core/textual_state";

export class AboutState extends TextualState{
  constructor(){
    super('AboutState')
  }

  getStateHeaderTitle(){
    return '关于游戏'
  }

  getDefaultBackState(){
    return 'SettingState'
  }

  getMainContentHTML(){
    return `
      <div class="head">
        <img src="res/ui/logo2.png" alt="logo">
      </div>

      <div class="text">
        <p>本游戏由 <a href="https://www.github.com/lionet1224">Lionet</a> 开发。</p>
        <p>游戏中大部分图片素材都是从网络上获取，若有侵权行为请联系我，我将会进行删除。</p>
        <p>感谢<a href="https://github.com/tobspr/shapez.io">shapez.io</a>开源项目，这个项目让我学习到了很多。</p>
      </div>
    `
  }

  onEnter(){
    const links = this.htmlElement.querySelectorAll('a[href]')
    links.forEach(link => {
      this.trackClicks(
        link,
        () => this.app.platform.openLink(link.getAttribute('href')),
        { preventClick: true }
      )
    })
  }
}